package com.mock.action.governmentofficeregion;

import java.util.ArrayList;
import java.util.List;

import com.mock.dao.GovernmentOfficeRegionDao;
import com.mock.dao.impl.GovernmentOfficeRegionDaoImpl;
import com.mock.model.GovernmentOfficeRegion;
import com.opensymphony.xwork2.ActionSupport;

public class AddGovernmentOfficeRegionAction extends ActionSupport{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	List<String> list = new ArrayList<String>();
	List<Long> listId = new ArrayList<Long>();
	
	
	
	
	
	public List<String> getList() {
		return list;
	}

	public void setList(List<String> list) {
		this.list = list;
	}

	

	public List<Long> getListId() {
		return listId;
	}

	public void setListId(List<Long> listId) {
		this.listId = listId;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		GovernmentOfficeRegionDao dao = new GovernmentOfficeRegionDaoImpl();
		List<GovernmentOfficeRegion> lstAll = dao.getAll(GovernmentOfficeRegion.class);
		for(GovernmentOfficeRegion gor : lstAll){
			listId.add(gor.getId());
			list.add(gor.getGovernmentOfficeRegionName());
		}
		
		
		return SUCCESS;
	}

	
}
